package com.jch.definition;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

public class DefinitionChannelInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        // 自定义解码器
        ch.pipeline().addLast(new DefinitionDecoder());
        // 自定义编码器
        ch.pipeline().addLast(new DefinitionEncoder());
        // 自定义接收数据处理器
        ch.pipeline().addLast(new DemoServerHandler());
    }
}
